<?php

namespace app\common\model;
use think\Db;

class Link extends Base
{
    /**
     * [getLinkByCondition]
     * @author [南風]
     * @param $map
     * @param $from
     * @param $size
     * @return array
     */
    public function getLinkByCondition($map, $from, $size)
    {
        $lists = $this->where($map)->limit($from, $size)->order('sort desc,id desc')->select();

        return $lists;
    }

    /**
     * [getLinkCountByCondition  根据搜索条件获取满足条数]
     * @author [南風]
     * @param $map
     * @return int|string
     */
    public function getLinkCountByCondition($map)
    {
        return $this->where($map)->count();
    }
}